package com.example.yls.demoa;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * Created by yls on 2018/12/18.
 */

public class MyReceiver extends BroadcastReceiver {

    private IOnTimeChangeListener listener;
    public  MyReceiver(IOnTimeChangeListener listener){
        this.listener=listener;
    };



    public void onReceive(Context context, Intent intent) {




           String time = intent.getStringExtra("TIME");
           listener.showTime(time);
           Log.e("MainActivity", "收到时间"+time);

    }
}
